---
title: Dot Pattern
date: 2023-07-20
description: A background dot pattern made with SVGs, fully customizable using Tailwind CSS.
author: nyxb
published: true
video: https://cdn.nyxbui.design/dot-pattern.mp4
---

<ComponentPreview name="dot-pattern-demo" />

## Installation

<Tabs defaultValue="cli">

<TabsList>
  <TabsTrigger value="cli">CLI</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>
<TabsContent value="cli">

```bash
npx nyxb@latest add dot-pattern
```

</TabsContent>

<TabsContent value="manual">

<Steps>

<Step>Copy and paste the following code into your project.</Step>

<ComponentSource name="dot-pattern" />

<Step>Update the import paths to match your project setup.</Step>

</Steps>

</TabsContent>

</Tabs>

## Examples

### Linear Gradient

<ComponentPreview name="dot-pattern-linear-gradient" />

## Props

### Dot Pattern

| Prop        | Type     | Default | Description                   |
| ----------- | -------- | ------- | ----------------------------- |
| `width`     | `any`    | `16`    | Width of the dot pattern      |
| `height`    | `any`    | `16`    | Height of the dot pattern     |
| `x`         | `any`    | `0`     | X position of the dot         |
| `y`         | `any`    | `0`     | Y position of the dot         |
| `cx`        | `any`    | `1`     | X position of the circle      |
| `cy`        | `any`    | `1`     | Y position of the circle      |
| `cr`        | `any`    | `1`     | Radius of the circle          |
| `className` | `string` | `-`     | Class name of the dot pattern |
